#include <properties/CommandContainer.h>

namespace liba {
namespace properties {

AbstractCommand* CommandContainer::FindAbstractCommand(const Atom& name) 
{
	Commands::const_iterator i = this->commands.find(name);
	if (i == this->commands.end())
		return 0;

	return i->second;
}

void CommandContainer::RegisterCommand(const Atom& name, AbstractCommand* cmd)
{
	std::pair<Commands::iterator, bool> insertResult =
		this->commands.insert(std::make_pair(name, cmd));

	LIBA_ASSERT(insertResult.second);
}

} // namespace properties
} // namespace liba